package cate.game.role.res.achievement.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBAchievement;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "领取成就点数奖励的请求")
@OperationSetter(GDOperation.ACHIEVEMENT_POINT_REWARD)
public class AchievementGetRewardReq implements MsgInput {
    @NoteField("奖励tid")
    public int tid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getRes().achievement.getPointReward(tid);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBAchievement.GET_REWARD_REQ;
    }
}
